package cn.timeapi.Applet.Mall.CatSquare.dao;

import cn.timeapi.Applet.Mall.CatSquare.entity.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    Cart selectByPrimaryKey(Integer id);

    List<Cart> selectAll();

    int updateByPrimaryKey(Cart record);

    int updateByPrimaryKeySelective(Cart record);


    Cart selectCartByopenIdProductId(@Param("openId") String openId, @Param("productId") Integer productId);

    List<Cart> selectCartByopenId(String openId);

    int selectCartProductCheckedStatusByOpenId(String openId);

    int deleteByopenIdProductIds(@Param("openId") String openId, @Param("productIds") List<String> productIds);

    int checkedOrUncheckedProduct(@Param("openId") String openId,@Param("productId")Integer productId,@Param("checked") Integer checked);

    int selectCartProductCount(String openId);

    List<Cart> selectCheckedCartByOpenId(String openId);
}